package com.xqyq.model;

import java.sql.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.OneToOne;
import javax.persistence.Table;

@Entity
@Table(name="report")
public class Report {
	private int report_id;
	private String report_name;
	private String cover;
	private Date date;
	private ReportContent report_content;
	
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	public int getReport_id() {
		return report_id;
	}
	public void setReport_id(int report_id) {
		this.report_id = report_id;
	}
	@Column(length=50,nullable=false)
	public String getReport_name() {
		return report_name;
	}
	public void setReport_name(String report_name) {
		this.report_name = report_name;
	}
	public Date getDate() {
		return date;
	}
	public void setDate(Date date) {
		this.date = date;
	}
	@OneToOne(cascade={CascadeType.REFRESH,CascadeType.PERSIST,CascadeType.REMOVE},fetch=FetchType.LAZY,mappedBy="report")
	public ReportContent getReport_content() {
		return report_content;
	}
	public void setReport_content(ReportContent report_content) {
		this.report_content = report_content;
	}
	@Lob
	@Column(columnDefinition="longtext")
	public String getCover() {
		return cover;
	}
	public void setCover(String cover) {
		this.cover = cover;
	}
	@Override
	public String toString() {
		return "Report [report_id=" + report_id + ", report_name="
				+ report_name + ", cover=" + cover + ", date=" + date
				+ ", report_content=" + report_content + "]";
	}
	
	
}
